<template>
	<view class="container">
		<u-navbar leftText=" " title=" " :bgColor="bgColor" :safeAreaInsetTop="true" :placeholder="true">
			<view class="u-nav-slot" slot="left" @click="left"><u-icon name="arrow-left" color="#000000" size="16"
					:bold="true"></u-icon></view>
		</u-navbar>
		<image class="bg-c" src="@/static/images/bg-c.png"></image>
		<view class="sign-up-title-c">
			<image class="bg1-l" src="/static/images/left.png" mode="widthFix"></image>
			<image class="bg2-2" src="/static/images/right.png" mode="widthFix"></image>
			<view class="sign-up-title-item">自我介绍</view>
			<view class="sign-up-title-tips" style="color: rgba(51, 51, 51, 0);">.</view>
		</view>
		<view class="div">
			<view class="div-l"></view>
			自我介绍
		</view>

		<view class="text"><u-textarea v-model="value" :cursorSpacing="100" :height="111" :maxlength="50"
				placeholder="请输入内容" count></u-textarea></view>
		<!-- <view class="div" style="margin-top: 44rpx;">
			<view class="div-l"></view>
			兴趣爱好
		</view>
		<view class="text"><u-textarea v-model="value1" :cursorSpacing="100" :maxlength="50" :height="111"
				placeholder="请输入内容" count></u-textarea></view> -->
		<!-- <view class="div" style="margin-top: 44rpx;">
			<view class="div-l"></view>
			心仪的TA
		</view>
		<view class="text"><u-textarea v-model="value2" :cursorSpacing="100" :maxlength="50" :height="111"
				placeholder="请输入内容" count></u-textarea></view> -->

		<button class="to-btn" @click="stepToNext">下一步</button>
		<view class="" style="height: 50rpx;"></view>
		<!-- <ELM ref="elm" :msg="tipMsg"></ELM> -->
		<ELM ref="elm" :msg="tipMsg"></ELM>
	</view>
</template>

<script>
	var _self;

	import {
		updateUserInfo
	} from '@/common/api.js';
	import ELM from '@/components/elm-toast/index.vue';
	export default {
		components: {
			ELM
		},
		data() {
			return {
				bgColor: 'rgba(0, 31, 63, 0)',
				value2: '',
				obj: {},
				value1: '',
				value: '',
				tipMsg: '',
				height: '',
				weight: '',
				education: '',
				income: '',
				house: '',
				car: '',
				school: '',
				wxCode: '',
				nation:''
			};
		},
		onLoad(options) {
			// this.obj = JSON.parse(options.obj);
			// console.log(this.obj);
			_self = this;
			console.log('options = ', options);
			_self.wxCode = options.wxCode;
			_self.height = options.height;
			_self.weight = options.weight;
			_self.education = options.education;
			_self.income = options.income;
			_self.house = options.house;
			_self.car = options.car;
			_self.school = options.school;
			_self.nation = options.nation;
			
		},
		methods: {
			left() {
				uni.navigateBack();
			},
			stepToNext() {
				if (this.value == '') {
					this.tipMsg = "请输入自我介绍";
					this.$refs.elm.showDialog();
					return;
				}
				if (this.value.length < 10) {
					this.tipMsg = "自我介绍不能少于十个字";
					this.$refs.elm.showDialog();
					return;
				}
				uni.navigateTo({
					url: '/pageslogin/index/tagsData?height=' + _self.height + '&weight=' + _self.weight +
						'&education=' + _self.education + '&school=' + _self.school +
						'&income=' + _self.income + '&wxCode=' + _self.wxCode + '&house=' + _self.house +
						'&car=' + _self.car + '&introduce=' + this.value + '&type=once' + '&nation=' + _self.nation
				})
				
				// var data = {
				// 	wxCode: _self.wxCode,
				// 	height: _self.height,
				// 	weight: _self.weight,
				// 	education: _self.education,
				// 	income: _self.income,
				// 	house: _self.house,
				// 	car: _self.car,
				// 	school: this.school,
				// 	introduce: this.value,
				// 	type: 'once'
				// }
				// console.log('data = ', data);
				// uni.navigateTo({
				// 	url: '/pageslogin/index/tagsData'
				// })

				// uni.navigateTo({
				// 	url: '/pageslogin/index/tagsData?height=' + _self.height + '&weight=' + _self.weight +
				// 		'&education=' + _self.education + '&income=' + _self.income + '&house=' + _self.house +
				// 		'&car=' + _self.car + '&school=' + this.school + '&introduce=' + this.value +
				// 		'&type=once' + '&wxCode=' + _self.wxCode
				// })
				// uni.navigateTo({
				// 	url: '/pageslogin/index/tagsData?height=' + '170' + '&weight=' + '40' +
				// 		'&education=' + 'benke' + '&income=' + '3000-5000' + '&house=' + '有房' +
				// 		'&car=' + '有车' + '&school=' + '新疆大学' + '&introduce=' + '真诚且用心、期待能在这里遇见那个与我相互理解、相互陪伴、相互成就的人。我相信缘分，也相信爱情的力量。' +
				// 		'&type=once' + '&wxCode=' + '17609928113'
				// })
				// uni.navigateTo({
				//     url: '/pageslogin/index/tagsData',
				//     success: res => {
				//         res.eventChannel.emit('userInfo',{data:data})
				//     },
				//     fail: () => {},
				//     complete: () => {}
				// });

			}
		}
	};
</script>

<style>
	.textarea {
		width: 606rpx;
		height: 128rpx;
		margin: 0 auto;
		margin-top: 34rpx;
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #434343;
		line-height: 64rpx;
	}

	page {
		width: 100%;
		height: 100%;
	}

	.container {
		position: relative;
		width: 100vw;
		height: 100%;
	}

	.to-btn {
		width: 536rpx;
		height: 84rpx;
		background: linear-gradient(86deg, #c2d2f9 0%, #c5c2f3 100%);
		border-radius: 42rpx 42rpx 42rpx 42rpx;
		text-align: center;
		line-height: 84rpx;
		margin: auto;
		margin-top: 64rpx;
		color: rgba(65, 92, 158, 0.9);
		font-weight: 400;
		font-family: 'PingFang SC-Bold, PingFang SC';
		font-size: 28rpx;
	}

	.text {
		width: 686rpx;
		height: 248rpx;
		background: rgba(159, 181, 235, 0.07);
		opacity: 1;
		border: 2rpx solid #d1deff;
		margin: 0 auto;
		border-radius: 30rpx;
		margin-top: 28rpx;
	}

	.num {
		font-size: 28rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #c9c9d0;
		line-height: 64rpx;
		margin-top: 34rpx;
		margin-right: 28rpx;
	}

	.div {
		width: 100%;
		height: 44rpx;
		font-size: 32rpx;
		font-family: 'PingFang SC-Bold, PingFang SC';
		font-weight: bold;
		color: #434343;
		line-height: 44rpx;
		display: flex;
		align-items: center;
	}

	.div-l {
		width: 10rpx;
		height: 32rpx;
		background: #446cd2;
		border-radius: 0px 0px 0px 0px;
		margin: 0 16rpx 0 58rpx;
	}

	page {
		width: 100%;
		height: 100%;
	}

	.bg-c {
		width: 100%;
		height: 100%;
		position: absolute;
		top: 0;
		pointer-events: none;
	}

	.sign-up-title-c {
		position: relative;
		width: 594rpx;
		height: 200rpx;
		margin: auto;
		margin-top: 52rpx;
		box-sizing: content-box;
		overflow: hidden;
		color: #333;
	}

	.bg1-l {
		position: absolute;
		top: 0rpx;
		left: 165rpx;
		width: 95rpx;
		z-index: -1;
	}

	.bg2-2 {
		position: absolute;
		top: 66rpx;
		right: 130rpx;
		width: 83rpx;
		z-index: -1;
	}

	.sign-up-title-item {
		font-size: 48rpx;
		color: rgba(45, 49, 50, 0.9);
		font-family: 'SourceHanSerifCN-Heavy';
		display: flex;
		margin-top: 66rpx;
		align-items: center;
		justify-content: center;


	}

	.yexy {
		margin-left: -20rpx;
	}

	.sign-up-title-tips {
		text-align: center;
		margin-top: 36rpx;
		font-size: 24rpx;
	}
</style>